package paper.check.word.commons;

public class CommonsUtils {
    public static String removeBlank(String text) {
        if (text == null)
            return text;
        return text.replace(String.valueOf((char) 160), " ").replaceAll("\\s", "");
    }

    public static String removeHeadBlank(String text) {
        if (text == null) {
            return text;
        }
        text = text.replaceAll("\\s", " ");
        for (int i = 0, len = text.length(); i < len; i++) {
            if (text.charAt(i) != ' ') {
                return text.substring(i);
            }
        }
        return "";
    }
}
